
/*************************************************************
 * Title: 
 * Description: 
 * Author: Snow Huang
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com
 * CreateTime: 2010-7-16 上午08:05:29
 * Copyright © 落羽社区 All right reserved
 ************************************************************/
Ext.ns("Snow");
Snow.MainPage = function () {
	_marginTop = 50;
	_bodyPanel = null;
	_menuPanel = null;
	_mainPanel = null;
	_loading = function () {
		/////////////////////////////////动画渐逝loading////////////////////////////////////////
		setTimeout(function () {
			Ext.get("loading").fadeOut({duration:0.6, remove:false});
			Ext.get("loading-mask").fadeOut({duration:0.6, remove:false});
		}, 650);
	};
	_initBodyPanel = function () {
		_bodyPanel = new Ext.Viewport({
			enableTabScroll : true,
			layout : "border",
			modal : true,
			items : [_menuPanel, _mainPanel]
		});
	};
	_initMainPanel = function() {
		_mainPanel = new Ext.TabPanel({
			region:"center", 
			id:"center-panel", 
			margins:_marginTop + " 5 5 0", 
			activeTab:0, 
			items:[{
				xtype:"panel", 
				title:Snow.MainPage.indexTitle, 
				border:false
			}]
		});
	};
	_initMenuPanel = function() {
		_menuPanel = new Ext.Panel({
			region:"west", 
			id:"west-panel", 
			title:Snow.MainPage.workbench, 
			split:true, 
			width:200, 
			minSize:175, 
			maxSize:400, 
			collapsible:true, 
			margins:_marginTop + " 0 5 5", 
			cmargins:_marginTop + " 5 5 5", 
			layout:"accordion", 
			layoutConfig:{animate:true}
		});
	};
	_initMenu = function() {
		Ext.Ajax.request({
			url : "getMenus.do",
			method : "post",
			success : function() {
				
			},
			failure : function() {
				
			}
		});
	};
	this.init = function () {
		_loading();
		_initMenuPanel();
		_initMainPanel();
		_initBodyPanel();
		_initMenu();
	};
};
Ext.onReady(function () {
	var mainPage = new Snow.MainPage();
	mainPage.init();
});

